package com.example.medicine.View;

import com.example.medicine.Bean.SystemFunction;
import com.example.medicine.Bean.SystemRole;
import com.example.medicine.Mapper.SystemFunctionMapper;
import com.example.medicine.Mapper.SystemRoleMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Slf4j
@Controller
public class SystemFunctionView {
    @Autowired
private SystemFunctionMapper systemfunctionMapper;
    @RequiresPermissions("功能管理")
    @RequestMapping("/systemfunction")
    public String systemfunctionShow(){
        log.info("功能列表页面");
        return "pages/SystemFunction/list";
    }
    @RequiresPermissions("功能管理")
    @RequestMapping("/systemfunction/create")
    public String systemfunctionCreateShow(){
        log.info("功能创建页面");
        return "pages/SystemFunction/create";
    }
    /**
     * Dlxx编辑展示页面
     */
    @RequiresPermissions("功能管理")
    @RequestMapping("/systemfunction/edit/{id}")
    public String getsystemfunctionById(@PathVariable String id, Model model) {
        log.info("功能编辑页面");
        SystemFunction SystemFunction= systemfunctionMapper.getById(id);
        SystemFunction.setID(id);
        model.addAttribute("function", SystemFunction);
        return "pages/SystemFunction/edit";
    }
}
